package org.example.day;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/09/04 9:06
 */
public class Solution2860 {

    public static void main(String[] args) {
        System.out.println(new Solution2860().countWays(Arrays.asList(1,1)));
    }

    public int countWays(List<Integer> nums) {
        int sum = 0;
        nums = nums.stream().sorted().collect(Collectors.toList());
        for (int i = 0; i < nums.size(); i++) {
            if(sum > nums.get(i)){
                sum++;
            }
        }
        return sum;
    }

}
